package com.banana.manager.forest.controller.handle;

import com.banana.manager.forest.entity.handle.DiscussBean;
import com.banana.manager.forest.entity.handle.RecordBean;
import com.banana.manager.forest.service.impl.handle.DiscussServiceImpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/discuss")
public class DiscussController {

    @Resource
    private DiscussServiceImpl discussService;

    @PostMapping("/addDiscuss")
    public DiscussBean addDiscuss(Integer recordId,@RequestBody DiscussBean discussBean){
        return discussService.addDiscuss(recordId, discussBean);
    }

    @GetMapping("/displayDiscuss")
    public List<RecordBean> showAllDiscuss(){
        return discussService.FindAllDiscuss();
    }
}
